ShadowColorsBlender

Helper class that blends the two native shadow colors into a single value appropriate for use with outlineShadowColorCompat.

The ambient and spot colors are blended in proportion to their corresponding alpha values set in the Context's theme.

Use of this class is completely optional. Any valid color can be used with the compat functionality.

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard
fun blend(@ColorInt ambientColor: Int, @ColorInt spotColor: Int): Int

Calculates a color blended from ambientColor and spotColor, proportional to their theme alpha values.

Link copied to clipboard

To be called from the corresponding function in the relevant UI component.